package net.onceface.application.dto;

import java.io.Serializable;
import java.util.Date;

import javax.ws.rs.BeanParam;
import javax.ws.rs.FormParam;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class ClientDTO implements Serializable,Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9102243947452827460L;
	
	@FormParam("id")
	private Long id;
	
	private Integer version;
	
	private String level;
	
	private String levelName;
	
	private Date createDate;
	
	private Date abolishDate;
	
	private Date lastLoginTime;
	
	private String salt;
	
	private String userAccount;
	
	@FormParam("userPassword")
	private String userPassword;
	
	private String userDesc;
	
	@FormParam("userAvatar")
	private String userAvatar;
	
	private boolean disabled;
	
	private String description;
	
	@FormParam("nick")
	private String nick;
	
	private Date lastModifyTime;
	
	@BeanParam
	private PersonDTO person;
	
	public ClientDTO(){}
	
	public ClientDTO(String userAccount, String userPassword, String salt, boolean disabled){
		this.userAccount = userAccount;
		this.salt = salt;
		this.disabled = disabled;
		this.userPassword = userPassword;
	}

	public Object clone() {  
		ClientDTO o = null;  
        try {  
            o = (ClientDTO) super.clone();  
        } catch (CloneNotSupportedException e) {  
            e.printStackTrace();  
        }  
        return o;  
    }  
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLevelName() {
		return levelName;
	}

	public void setLevelName(String levelName) {
		this.levelName = levelName;
	}

	public Integer getVersion() {
		return version;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getAbolishDate() {
		return abolishDate;
	}

	public void setAbolishDate(Date abolishDate) {
		this.abolishDate = abolishDate;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	public String getUserDesc() {
		return userDesc;
	}
	public void setUserDesc(String userDesc) {
		this.userDesc = userDesc;
	}

	public String getUserAvatar() {
		return userAvatar;
	}

	public void setUserAvatar(String userAvatar) {
		this.userAvatar = userAvatar;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getNick() {
		return nick;
	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	public Date getLastModifyTime() {
		return lastModifyTime;
	}

	public void setLastModifyTime(Date lastModifyTime) {
		this.lastModifyTime = lastModifyTime;
	}

	public PersonDTO getPerson() {
		return person;
	}

	public void setPerson(PersonDTO person) {
		this.person = person;
	}

}
